package com.codez.unionpay.springboot.jdbc.multidatabase;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhengdechao
 * @createTime : 2019-05-21
 *
 */

@RestController
public class HelloService {
	@Autowired
	@Qualifier("jdbcTemplateOne")
	JdbcTemplate jdbcTemplateOne;
	@Resource(name = "jdbcTemplateTwo")
	JdbcTemplate jdbcTemplateTwo;

//	    public List<User> getAllUser() {
//	        List<User> list = jdbcTemplateOne.query("select * from t_user", new BeanPropertyRowMapper<>(User.class));
//	        return list;
//	    }
//	    public List<User> getAllUser2() {
//	        List<User> list = jdbcTemplateTwo.query("select * from t_user", new BeanPropertyRowMapper<>(User.class));
//	        return list;
//	    }
}
